<?php
	include_once "binhluan_db.php";
	
	class binhluan_bs
	{
		//--------------Field---------------
		private $MaBinhLuan = 0;
		public function SetMaBinhLuan($MaBinhLuan)           { $this->MaBinhLuan = $MaBinhLuan;           }
		public function GetMaBinhLuan()                      { return $this->MaBinhLuan;                  }
		
		private $MaBaiViet = 0;
		public function SetMaBaiViet($MaBaiViet)             { $this->MaBaiViet = $MaBaiViet;             }
		public function GetMaBaiViet()                       { return $this->MaBaiViet;                   }
		
		private $MaNguoiDung = 0;
		public function SetMaNguoiDung($MaNguoiDung)         { $this->MaNguoiDung = $MaNguoiDung;         }
		public function GetMaNguoiDung()                     { return $this->MaNguoiDung;                 }
		
		private $NoiDungBinhLuan = "";
		public function SetNoiDungBinhLuan($NoiDungBinhLuan) { $this->NoiDungBinhLuan = $NoiDungBinhLuan; }
		public function GetNoiDungBinhLuan()                 { return $this->NoiDungBinhLuan;             }
		
		private $ThoiGian = "0000-00-00 00:00:00";
		public function SetThoiGian($ThoiGian)               { $this->ThoiGian = $ThoiGian;               }
		public function GetThoiGian()                        { return $this->ThoiGian;                    }
		
		private $MaTrangThai = -1;
		public function SetMaTrangThai($MaTrangThai)         { $this->MaTrangThai = $MaTrangThai;         }
		public function GetMaTrangThai()                     { return $this->MaTrangThai;                 }
		
		private $PIN = "";
		public function SetPIN($PIN)                         { $this->PIN = $PIN;                         }
		public function GetPIN()                             { return $this->PIN;                         }
		
		//--------------Method---------------
		public function Them()
		{
			$data = new binhluan_db();
			return $data->Them($this->MaBaiViet, $this->MaNguoiDung, $this->NoiDungBinhLuan, $this->ThoiGian, $this->MaTrangThai);
		}
		
		public function CapNhat()
		{
			$data = new binhluan_db();
			return $data->CapNhat($this->MaBinhLuan, $this->MaBaiViet, $this->MaNguoiDung, $this->NoiDungBinhLuan, $this->ThoiGian, $this->MaTrangThai, $this->PIN);
		}
		
		public function Xoa()
		{
			$data = new binhluan_db();
			return $data->Xoa($this->MaBinhLuan);
		}
		
		public function LayDanhSach()
		{
			$data = new binhluan_db();
			return $data->LayDanhSach($this->MaBinhLuan,$this->MaBaiViet , $this->MaNguoiDung, $this->MaTrangThai);
		}
		public function LayDanhSachPhanTrang($Start, $Limit)
		{
			$data = new binhluan_db();
			return $data->LayDanhSachPhanTrang($Start, $Limit, $this->MaBinhLuan, $this->MaBaiViet, $this->MaNguoiDung, $this->MaTrangThai);
		}
		public function LayDanhSachTheoTrangThaiBaiViet($MaTrangThaiBaiViet)
		{
			$data = new binhluan_db();
			return $data->LayDanhSachTheoTrangThaiBaiViet($MaTrangThaiBaiViet, $this->MaTrangThai);
		}
		
		public function DemSoBinhLuanTheoMaNguoiDung()
		{
			$data = new binhluan_db();
			return $data->DemSoBinhLuanTheoMaNguoiDung($this->MaNguoiDung);
		}
	}
?>